import request from '@/utils/request'
//我的考勤----日历数据
export function getMonthData(query) {
	return request({
		url: '/punchCard/getUserMonthData',
		method: 'get',
		params: query
	})
}
//获取用户某一天的考勤数据
export function getUserDataByDate(query) {
	return request({
		url: '/punchCard/getUserDataByDate',
		method: 'get',
		params: query
	})
}
//获取打卡列表数据
export function getDkList(query) {
	return request({
		url: '/punchCard/getList',
		method: 'get',
		params: query
	})
}
//获取用户下拉(人和头像)
export function getUserOptions(query) {
	return request({
		url: '/system/user/options',
		method: 'get',
		params: query
	})
}
//获取请假申请列表
export function getAbsenceList(query) {
	return request({
		url: '/absence/list',
		method: 'get',
		params: query
	})
}

// 请假申请
export function absenceAdd(data) {
	return request({
		url: '/absence',
		method: 'post',
		data: data
	})
}
//请假申请（修改）
export function updateAbsence(data) {
	return request({
		url: '/absence',
		method: 'put',
		data: data
	})
}

//获取补卡列表（1：我的补卡申请，2，补卡审核
export function reissueList(query) {
	return request({
		url: '/punchCard/reissueList',
		method: 'get',
		params: query
	})
}
//获取补卡详情
export function getReissue(query) {
	return request({
		url: '/punchCard/getReissue',
		method: 'get',
		params: query
	})
}
//审核补卡
export function auditReissue(data) {
	return request({
		url: '/punchCard/auditReissue',
		method: 'post',
		data: data
	})
}

//获取打卡列表
export function cardList(data) {
  return request({
    url:'/punchCard/getList',
    method:'get',
    params:data
  })
}

//获取成员考勤数据
export function getDeptAttendance(query) {
	return request({
		url: '/punchCard/getDeptAttendance',
		method: 'get',
		params: query
	})
}




// 删除请假申请
export function deleteAbsence(operId) {
	return request({
		url: '/absence/' + operId,
		method: 'delete'
	})
}
//根据id获取详情
export function getAbsenceDetail(query) {
	return request({
		url: '/absence/getDetail',
		method: 'get',
		params: query
	})
}
//根据请假时间计算请假时长
export function getDuration(query) {
	return request({
		url: '/absence/getDuration',
		method: 'get',
		params: query
	})
}
//获取 用户的剩余加班时间
export function getOverworkHour(query) {
	return request({
		url: '/absence/getOverworkHour',
		method: 'get',
		params: query
	})
}

//请假审核
export function absenceApprove(data) {
	return request({
		url: '/absence/approve',
		method: 'post',
		data: data
	})
}
//销假申请
export function absencerReportBack(data) {
	return request({
		url: '/absence/reportBack',
		method: 'post',
		data: data
	})
}
//审核销假申请
export function approveReportBack(data) {
	return request({
		url: '/absence/approveReportBack',
		method: 'post',
		data: data
	})
}
//修改销假申请
export function editReportBack(data) {
	return request({
		url: '/absence/editReportBack',
		method: 'post',
		data: data
	})
}


//=====================================================================================================加班的========================

//获取加班列表
export function getOverworkList(query) {
	return request({
		url: '/overwork/list',
		method: 'get',
		params: query
	})
}
//获取项目下拉
export function getProjectSelect(query) {
	return request({
		url: '/project/getProjectSelect',
		method: 'get',
		params: query
	})
}


//新增加班
export function addOverWork(data) {
	return request({
		url: '/overwork',
		method: 'post',
		data: data
	})
}




// 删除加班申请
export function deleteOverwork(overworkId) {
	return request({
		url: '/overwork/' + overworkId,
		method: 'delete'
	})
}



//根据id获取详情
export function getOverWorkDetail(query) {
	return request({
		url: '/overwork/getDetail',
		method: 'get',
		params: query
	})
}

//加班申请（修改）
export function updateOverwork(data) {
	return request({
		url: '/overwork',
		method: 'put',
		data: data
	})
}

//获取加班审核列表(领导级别)
export function getAuditList(query) {
	return request({
		url: '/overwork/getAuditList',
		method: 'get',
		params: query
	})
}

//加班审核
export function overworkApprove(data) {
	return request({
		url: '/overwork/audit',
		method: 'post',
		data: data
	})
}

//加班统计
export function getTjData(query) {
	return request({
		url: '/overwork/getTjData',
		method: 'get',
		params: query
	})
}

// =========================================项目===================================





//获取项目列表
export function getProjectList(query) {
	return request({
		url: '/project/list',
		method: 'get',
		params: query
	})
}
//获取部门下拉树列表
export function getDeptTree(query) {
	return request({
		url: '/system/dept/treeselect',
		method: 'get',
		params: query
	})
}
//获取部门成员数据
export function getDeptUser(query) {
	return request({
		url: '/project/getDeptUser/',
		method: 'get',
		params: query
	})
}

//添加项目
export function addProject(data) {
	return request({
		url: '/project/add',
		method: 'post',
		data: data
	})
}

//修改项目
export function updateProject(data) {
	return request({
		url: '/project/edit',
		method: 'put',
		data: data
	})
}


//验证项目名称是否已存在
export function verifiProjectName(query) {
	return request({
		url: '/project/verificationProjectName',
		method: 'get',
		params: query
	})
}

//获取项目详情

export function getProjectDetail(query) {
	return request({
		url: '/project/getDetail',
		method: 'get',
		params: query
	})
}

//添加跟进
export function addFollow(data) {
	return request({
		url: '/follow/add',
		method: 'post',
		data: data
	})
}

//获取跟进记录
export function followList(query) {
	return request({
		url: '/follow/list',
		method: 'get',
		params: query
	})
}



//根据项目id获取项目进度列表
export function getProgressRateList(query) {
	return request({
		url: '/project/getProgressRateList',
		method: 'get',
		params: query
	})
}

//添加项目进度
export function addProjectProgressRate(data) {
	return request({
		url: '/project/addProjectProgressRate',
		method: 'post',
		data: data
	})
}

//获取项目工时统计列表
export function getWorkHourList(query) {
	return request({
		url: '/project/getWorkHourList',
		method: 'get',
		params: query
	})
}

//根据日期获取日报信息
export function getReportByDate(query) {
	return request({
		url: '/dailyReport/getReportByDate',
		method: 'get',
		params: query
	})
}
//根据项目id和用户名获取日报列表
export function getReportListByProject(query) {
	return request({
		url: '/dailyReport/getReportListByProject',
		method: 'get',
		params: query
	})
}
//获取项目操作日志列表
export function getProjectOperList(query) {
	return request({
		url: '/project/getProjectOperList',
		method: 'get',
		params: query
	})
}

//根据项目id分页获取文档库列表
export function getFolderList(query) {
	return request({
		url: '/documentFolder/list',
		method: 'get',
		params: query
	})
}
//修改文档库
export function editFolder(data) {
	return request({
		url: '/documentFolder/Edit',
		method: 'put',
		data: data
	})
}
//删除文档库
export function deleteFolder(id) {
	return request({
		url: '/documentFolder/delete/' + id,
		method: 'delete'
	})
}

//添加文档库
export function addFolder(data) {
	return request({
		url: '/documentFolder/add',
		method: 'post',
		data: data
	})
}
//多文件上传
export function fileUploads(data) {
	return request({
		url: '/common/uploads',
		method: 'post',
		data: data
	})
}
//新增文档
export function addDocument(data) {
	return request({
		url: '/document/add',
		method: 'post',
		data: data
	})
}
//查看文档库中的文件列表
export function getDoucument(query) {
	return request({
		url: '/document/list',
		method: 'get',
		params: query
	})
}

//删除文档
export function deleteDocument(id) {
	return request({
		url: '/document/delete/' + id,
		method: 'delete'
	})
}
//通用下载请求
export function download(query) {
	return request({
		url: '/common/download/resource',
		method: 'get',
		params: query
	})
}

//导出打卡记录
export function exportPunchCard(query) {
	return request({
		url: '/punchCard/exportPunchCard',
		method: 'get',
		params: query,
		isBlob:true
	})
}
//导出报表
export function exportReport(query) {
	return request({
		url: '/punchCard/exportReport',
		method: 'get',
		params: query,
		isBlob:true
	})
}
//-------------------------------------------访客预约------------------------
//获取拜访记录列表
export function recordList(query) {
	return request({
		url: '/visitor/record/list',
		method: 'get',
		params: query,
	})
}
//获取通知人
export function getRemindUser(query) {
	return request({
		url: '/visitor/getRemindUser',
		method: 'get',
		params: query,
	})
}
//配置通知人
export function configUser(data) {
	return request({
		url: '/visitor/configUser',
		method: 'post',
		params: data,
	})
}


